<template>
  <div>pinia演示</div>
  <div>
    {{ count }} -- {{ doubleCount }}
    <button @click="increment">加</button>
    <button @click="router.push('/study/five')">另一个pinia演示页面</button>
  </div>
  <hr />
  <CompTwo></CompTwo>
</template>

<script setup>
import { ref } from 'vue'
import { useCounterStore } from '@/stores/counter'
import { storeToRefs } from 'pinia'
import { useRouter } from 'vue-router'
import CompTwo from '@/components/CompTwo.vue'

const router = useRouter()

const { increment } = useCounterStore()

const { count, doubleCount } = storeToRefs(useCounterStore())
</script>
<style scoped></style>
